﻿<%@ include file="/WEB-INF/jsp/include.jsp" %>
<link href="<%=request.getContextPath()%>/images/skin.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #EEF2FB;
}
table{border-collapse:collapse;}
.order-form th,.order-form td{border:solid 1px black;}
-->
</style>
<link href="<%=request.getContextPath()%>/images/skin.css" rel="stylesheet" type="text/css" />
<script src="<%=request.getContextPath()%>/js/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/nyroModal.css" type="text/css" media="screen" />
<script type="text/javascript" src="<%=request.getContextPath()%>/js/nyroModal-1.6.2/js/jquery.nyroModal-1.6.2.min.js"></script>
<script src="<%=request.getContextPath()%>/js/pub/pub.js" type="text/javascript"></script>
<script src="<%=request.getContextPath()%>/js/doorscrm/orders/add_orders_doors.js" type="text/javascript"></script>
<body>
<table width="200%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="17" valign="top" background="<%=request.getContextPath()%>/images/mail_leftbg.gif"><img src="<%=request.getContextPath()%>/images/left-top-right.gif" width="17" height="29" /></td>
    <td width="1428" valign="top" background="<%=request.getContextPath()%>/images/content-bg.gif">
  <table width="100%" height="31" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
          <tr>
            <td height="31"><div class="titlebt">订单界面</div></td>
          </tr>
        </table>
    </td>
    <td width="42" valign="top" background="<%=request.getContextPath()%>/images/mail_rightbg.gif"><img src="<%=request.getContextPath()%>/images/nav-right-bg.gif" width="16" height="29" /></td>
  </tr>
  <tr>
    <td valign="middle" background="<%=request.getContextPath()%>/images/mail_leftbg.gif">&nbsp;</td>
    <td valign="top" bgcolor="#F7F8F9">
    <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td colspan="2" valign="top">&nbsp;</td>
        <td width="7%">&nbsp;</td>
        <td width="40%" valign="top">&nbsp;</td>
      </tr>
      
      <tr>
      	<td colspan="4">
      		<form name="form1" method="post" id="form1" action="">
        	<table width="100%" cellpadding="4" cellspacing="0" class="order-form">
        		
            	<tr>
                	<th colspan="18">订单详细信息</th>
                </tr>
            	<tr>
            	  <td colspan="3" rowspan="3"><p>编号:${order.orderno}</p>           	      </td>
          	      <td width="8%" align="right"><div align="right">经销商</div></td>
          	      <td colspan="3">&nbsp;${order.sourcename}</td>
          	      <td width="7%"><div align="right">下单时间</div></td>
          	      <td colspan="2">&nbsp;<fmt:formatDate value="${order.createdate}" pattern="yyyy-MM-dd"/></td>
          	      <td width="11%"><div align="right">预计出货时间</div></td>
          	      <td colspan="2">&nbsp;<fmt:formatDate value="${order.exdeliverydate}" pattern="yyyy-MM-dd"/></td>
          	      <td colspan="5">&nbsp;</td>
       	      </tr>
            	<tr>
            	  <td align="right"><div align="right">用户</div></td>
          	      <td colspan="3">&nbsp;${order.customer}</td>
          	      <td><div align="right">用户电话</div></td>
          	      <td colspan="2">&nbsp;${order.telephone}</td>
          	      <td><div align="right">用户手机</div></td>
          	      <td colspan="2">&nbsp;${order.mobile}</td>
          	      <td colspan="5">&nbsp;</td>
       	      </tr>
            	<tr>
            	  <td align="right"><div align="right">用户地址</div></td>
          	      <td colspan="6">&nbsp;${order.address}</td>
          	      <td>&nbsp;</td>
          	      <td colspan="2">&nbsp;</td>
          	      <td colspan="5">&nbsp;</td>
       	      </tr>
            	<tr>
            	  <td colspan="2" rowspan="3"><div align="center">序号</div></td>
            	  <td colspan="2" rowspan="3" align="center"><div align="center">产品名称</div></td>
          	      <td width="4%" rowspan="3"><div align="center">型号</div></td>
          	      <td colspan="2"><div align="center">数量价格</div></td>
          	      <td rowspan="3"><div align="center">门洞原始尺寸（高*宽*厚，单位：MM）</div></td>
          	      <td width="6%" rowspan="3"><div align="center">是/否已扣除地砖/木地板厚度</div></td>
          	      <td width="5%" rowspan="3"><div align="center">是/否单丁墙/双单丁墙</div></td>
          	      <td colspan="5"><div align="center">产品规格</div></td>
          	      <td width="6%" rowspan="3"><div align="center">面板材质</div></td>
          	      <td width="6%" rowspan="3"><div align="center">颜色</div></td>
          	      <td width="9%" rowspan="3"><div align="center">备注</div></td>
       	      </tr>
            	<tr>
            	  <td width="3%" rowspan="2"><div align="center">数量</div></td>
          	      <td width="3%" rowspan="2"><div align="center">价格</div></td>
          	      <td rowspan="2"><div align="center">门扇尺寸(MM)</div></td>
          	      <td width="7%" rowspan="2"><div align="center">门套尺寸(MM)</div></td>
          	      <td colspan="3"><div align="center">门边线信息</div></td>
       	      </tr>
            	<tr>
            	  <td width="4%"><div align="center">长度</div></td>
            	    <td width="3%"><div align="center">数量</div></td>
          	      <td width="7%"><div align="center">规格</div></td>
       	      </tr>
       	      <c:forEach var="rs" items="${list_1}" varStatus="status">
	            	<tr>
	            	  <td width="3%">
	            	      <div align="center">
	            	        <input type="radio" name="detail_radio" id="radio" value="${rs.id}">
	       	              </div></td>
	            	  <td width="3%"><div align="center">${status.count}</div></td>
	            	    <c:if test="${status.count==1}">
	          	      	<td width="5%" rowspan="${count_1}"><div align="center">门</div></td>
	          	      </c:if>
	          	      <td><div align="center">${rs.productsery}</div></td>
	          	      <td><div align="center">${rs.productno}</div></td>
	          	      <td><div align="center">${rs.number}</div></td>
	          	      <td><div align="center">${rs.price}</div></td>
	          	      <td><div align="center">${rs.originalhigh}*${rs.originalwidth}*${rs.originallength}</div></td>
	          	      <td><div align="center"><c:if test="${rs.isthick==1}">是</c:if><c:if test="${rs.isthick==0}">否</c:if></div></td>
	          	      <td><div align="center">
	          	      	<c:if test="${rs.issingle==0}">正常</c:if>
	          	      	<c:if test="${rs.issingle==1}">单丁墙</c:if>
	          	      	<c:if test="${rs.issingle==2}">双单丁墙</c:if>
	          	      	</div></td>
	          	      <td><div align="center">
		          	     <c:choose>
									    <c:when test="${fn:length(rs.confirmwidth) > 4}">
									     ${rs.confirmhigh}*(${rs.confirmwidth})*${rs.confirmlength}
									    </c:when>
									    <c:otherwise>
									     ${rs.confirmhigh}*${rs.confirmwidth}*${rs.confirmlength}
									    </c:otherwise>
									   </c:choose> 
								   </div></td>
	          	      <td><div align="center">${rs.tbconfirmhigh}*${rs.tbconfirmwidth}*${rs.tbconfirmlength}</div></td>
	          	      <td><div align="center">${rs.doorslinelength}MM<c:if test="${!empty rs.doorslinelength2}"></br>${rs.doorslinelength2}MM</c:if></div></td>
	          	      <td><div align="center">${rs.doorslinenum}根<c:if test="${rs.doorslinenum2>0}"></br>${rs.doorslinenum2}根</c:if></div></td>
	          	      <td><div align="center">${rs.doorsline}</div></td>
	          	      <td><div align="center">${rs.facetable}</div></td>
	          	      <td><div align="center">${rs.colour}</div></td>
	          	      <td><div align="center">${rs.remark}</div></td>
	       	      </tr>
	       	  </c:forEach>

             <c:forEach var="rs" items="${list_2}" varStatus="status">
	            	<tr>
	            	  <td width="3%">
	            	      <div align="center">
	            	       <input type="radio" name="detail_radio" id="radio" value="${rs.id}">
	       	              </div></td>
	            	  <td width="3%"><div align="center">${status.count}</div></td>
	            	    <c:if test="${status.count==1}">
	          	      	<td width="5%" rowspan="${count_2}"><div align="center">空门套</div></td>
	          	      </c:if>
	          	      <td><div align="center">${rs.productsery}</div></td>
	          	      <td><div align="center">${rs.productno}</div></td>
	          	      <td><div align="center">${rs.number}</div></td>
	          	      <td><div align="center">${rs.price}</div></td>
	          	      <td><div align="center">${rs.originalhigh}*${rs.originalwidth}*${rs.originallength}</div></td>
	          	      <td><div align="center"><c:if test="${rs.isthick==1}">是</c:if><c:if test="${rs.isthick==0}">否</c:if></div></td>
	          	      <td><div align="center">
	          	      	<c:if test="${rs.issingle==0}">正常</c:if>
	          	      	<c:if test="${rs.issingle==1}">单丁墙</c:if>
	          	      	<c:if test="${rs.issingle==2}">双单丁墙</c:if>
	          	      	</div></td>
	          	      <td><div align="center">${rs.confirmhigh}*${rs.confirmwidth}*${rs.confirmlength}</div></td>
	          	      <td><div align="center">${rs.tbconfirmhigh}*${rs.tbconfirmwidth}*${rs.tbconfirmlength}</div></td>
	          	      <td><div align="center">${rs.doorslinelength}MM<c:if test="${!empty rs.doorslinelength2}"></br>${rs.doorslinelength2}MM</c:if></div></td>
	          	      <td><div align="center">${rs.doorslinenum}根<c:if test="${rs.doorslinenum2>0}"></br>${rs.doorslinenum2}根</c:if></div></td>
	          	      <td><div align="center">${rs.doorsline}</div></td>
	          	      <td><div align="center">${rs.facetable}</div></td>
	          	      <td><div align="center">${rs.colour}</div></td>
	          	      <td><div align="center">${rs.remark}</div></td>
	       	      </tr>
	       	  </c:forEach>
            
            <c:forEach var="rs" items="${list_3}" varStatus="status">
	            	<tr>
	            	  <td width="3%">
	            	      <div align="center">
	            	        <input type="radio" name="detail_radio" id="radio" value="${rs.id}">
	       	              </div></td>
	            	  <td width="3%"><div align="center">${status.count}</div></td>
	            	    <c:if test="${status.count==1}">
	          	      	<td width="5%" rowspan="${count_3}"><div align="center">窗户套</div></td>
	          	      </c:if>
	          	      <td><div align="center">${rs.productsery}</div></td>
	          	      <td><div align="center">${rs.productno}</div></td>
	          	      <td><div align="center">${rs.number}</div></td>
	          	      <td><div align="center">${rs.price}</div></td>
	          	      <td><div align="center">${rs.originalhigh}*${rs.originalwidth}*${rs.originallength}</div></td>
	          	      <td><div align="center"><c:if test="${rs.isthick==1}">是</c:if><c:if test="${rs.isthick==0}">否</c:if></div></td>
	          	      <td><div align="center">
	          	      	<c:if test="${rs.issingle==0}">正常</c:if>
	          	      	<c:if test="${rs.issingle==1}">单丁墙</c:if>
	          	      	<c:if test="${rs.issingle==2}">双单丁墙</c:if>
	          	      	</div></td>
	          	      <td><div align="center">${rs.confirmhigh}*${rs.confirmwidth}*${rs.confirmlength}</div></td>
	          	      <td><div align="center">${rs.tbconfirmhigh}*${rs.tbconfirmwidth}*${rs.tbconfirmlength}</div></td>
	          	      <td><div align="center">${rs.doorslinelength}MM<c:if test="${!empty rs.doorslinelength2}"></br>${rs.doorslinelength2}MM</c:if></div></td>
	          	      <td><div align="center">${rs.doorslinenum}根<c:if test="${rs.doorslinenum2>0}"></br>${rs.doorslinenum2}根</c:if></div></td>
	          	      <td><div align="center">${rs.doorsline}</div></td>
	          	      <td><div align="center">${rs.facetable}</div></td>
	          	      <td><div align="center">${rs.colour}</div></td>
	          	      <td><div align="center">${rs.remark}</div></td>
	       	      </tr>
	       	  </c:forEach>
            
            <c:forEach var="rs" items="${list_4}" varStatus="status">
	            	<tr>
	            	  <td width="3%">
	            	      <div align="center">
	            	        <input type="radio" name="detail_radio" id="radio" value="${rs.id}">
	       	              </div></td>
	            	  <td width="3%"><div align="center">${status.count}</div></td>
	            	    <c:if test="${status.count==1}">
	          	      	<td width="5%" rowspan="${count_4}"><div align="center">衣柜/厨房门</div></td>
	          	      </c:if>
	          	      <td><div align="center">${rs.productsery}</div></td>
	          	      <td><div align="center">${rs.productno}</div></td>
	          	      <td><div align="center">${rs.number}</div></td>
	          	      <td><div align="center">${rs.price}</div></td>
	          	      <td><div align="center">${rs.originalhigh}*${rs.originalwidth}*${rs.originallength}</div></td>
	          	      <td><div align="center"><c:if test="${rs.isthick==1}">是</c:if><c:if test="${rs.isthick==0}">否</c:if></div></td>
	          	      <td><div align="center">
	          	      	<c:if test="${rs.issingle==0}">正常</c:if>
	          	      	<c:if test="${rs.issingle==1}">单丁墙</c:if>
	          	      	<c:if test="${rs.issingle==2}">双单丁墙</c:if>
	          	      	</div></td>
	          	      <td><div align="center">${rs.confirmhigh}*${rs.confirmwidth}*${rs.confirmlength}</div></td>
	          	      <td><div align="center">${rs.tbconfirmhigh}*${rs.tbconfirmwidth}*${rs.tbconfirmlength}</div></td>
	          	      <td><div align="center">${rs.doorslinelength}MM<c:if test="${!empty rs.doorslinelength2}"></br>${rs.doorslinelength2}MM</c:if></div></td>
	          	      <td><div align="center">${rs.doorslinenum}根<c:if test="${rs.doorslinenum2>0}"></br>${rs.doorslinenum2}根</c:if></div></td>
	          	      <td><div align="center">${rs.doorsline}</div></td>
	          	      <td><div align="center">${rs.facetable}</div></td>
	          	      <td><div align="center">${rs.colour}</div></td>
	          	      <td><div align="center">${rs.remark}</div></td>
	       	      </tr>
	       	  </c:forEach>
            
            <c:forEach var="rs" items="${list_5}" varStatus="status">
	            	<tr>
	            	  <td width="3%">
	            	      <div align="center">
	            	        <input type="radio" name="detail_radio" id="radio" value="${rs.id}">
	       	              </div></td>
	            	  <td width="3%"><div align="center">${status.count}</div></td>
	            	    <c:if test="${status.count==1}">
	          	      	<td width="5%" rowspan="${count_5}"><div align="center">护墙条</div></td>
	          	      </c:if>
	          	      <td><div align="center">${rs.productsery}</div></td>
	          	      <td><div align="center">${rs.productno}</div></td>
	          	      <td><div align="center">${rs.number}</div></td>
	          	      <td><div align="center">${rs.price}</div></td>
	          	      <td><div align="center">${rs.originalhigh}*${rs.originalwidth}*${rs.originallength}</div></td>
	          	      <td><div align="center"><c:if test="${rs.isthick==1}">是</c:if><c:if test="${rs.isthick==0}">否</c:if></div></td>
	          	      <td><div align="center">
	          	      	<c:if test="${rs.issingle==0}">正常</c:if>
	          	      	<c:if test="${rs.issingle==1}">单丁墙</c:if>
	          	      	<c:if test="${rs.issingle==2}">双单丁墙</c:if>
	          	      	</div></td>
	          	      <td><div align="center">${rs.confirmhigh}*${rs.confirmwidth}*${rs.confirmlength}</div></td>
	          	      <td><div align="center">${rs.tbconfirmhigh}*${rs.tbconfirmwidth}*${rs.tbconfirmlength}</div></td>
	          	      <td><div align="center">${rs.doorslinelength}MM<c:if test="${!empty rs.doorslinelength2}"></br>${rs.doorslinelength2}MM</c:if></div></td>
	          	      <td><div align="center">${rs.doorslinenum}根<c:if test="${rs.doorslinenum2>0}"></br>${rs.doorslinenum2}根</c:if></div></td>
	          	      <td><div align="center">${rs.doorsline}</div></td>
	          	      <td><div align="center">${rs.facetable}</div></td>
	          	      <td><div align="center">${rs.colour}</div></td>
	          	      <td><div align="center">${rs.remark}</div></td>
	       	      </tr>
	       	  </c:forEach>
            
             <c:forEach var="rs" items="${list_6}" varStatus="status">
	            	<tr>
	            	  <td width="3%">
	            	      <div align="center">
	            	        <input type="radio" name="detail_radio" id="radio" value="${rs.id}">
	       	              </div></td>
	            	  <td width="3%"><div align="center">${status.count}</div></td>
	            	    <c:if test="${status.count==1}">
	          	      	<td width="5%" rowspan="${count_6}"><div align="center">踢脚线</div></td>
	          	      </c:if>
	          	      <td><div align="center">${rs.productsery}</div></td>
	          	      <td><div align="center">${rs.productno}</div></td>
	          	      <td><div align="center">${rs.number}</div></td>
	          	      <td><div align="center">${rs.price}</div></td>
	          	      <td><div align="center">${rs.originalhigh}*${rs.originalwidth}*${rs.originallength}</div></td>
	          	      <td><div align="center"><c:if test="${rs.isthick==1}">是</c:if><c:if test="${rs.isthick==0}">否</c:if></div></td>
	          	      <td><div align="center">
	          	      	<c:if test="${rs.issingle==0}">正常</c:if>
	          	      	<c:if test="${rs.issingle==1}">单丁墙</c:if>
	          	      	<c:if test="${rs.issingle==2}">双单丁墙</c:if>
	          	      	</div></td>
	          	      <td><div align="center">${rs.confirmhigh}*${rs.confirmwidth}*${rs.confirmlength}</div></td>
	          	      <td><div align="center">${rs.tbconfirmhigh}*${rs.tbconfirmwidth}*${rs.tbconfirmlength}</div></td>
	          	      <td><div align="center">${rs.doorslinelength}MM<c:if test="${!empty rs.doorslinelength2}"></br>${rs.doorslinelength2}MM</c:if></div></td>
	          	      <td><div align="center">${rs.doorslinenum}根<c:if test="${rs.doorslinenum2>0}"></br>${rs.doorslinenum2}根</c:if></div></td>
	          	      <td><div align="center">${rs.doorsline}</div></td>
	          	      <td><div align="center">${rs.facetable}</div></td>
	          	      <td><div align="center">${rs.colour}</div></td>
	          	      <td><div align="center">${rs.remark}</div></td>
	       	      </tr>
	       	  </c:forEach>
            
            
            
            	<tr>
            	  <td colspan="2">&nbsp;</td>
            	  <td><div align="center">总计</div></td>
            	  <td colspan="15">${total_price}元</td>
           	  </tr>
            	<tr>
            	  <td colspan="18">
            	  	&nbsp;&nbsp;&nbsp;&nbsp;
            	  	<input type="button" onclick="add_detail()" name="button" id="button" value="新增">
            	  	&nbsp;&nbsp;
            	    <input type="submit" name="button2" id="button2" value="修改">
            	    &nbsp;&nbsp;
            	    <input type="button" onclick="del_detail()"  name="button3" id="button3" value="删除">
            	    &nbsp;&nbsp;
           	      <input type="button" onclick="add_order_back()" name="button4" id="button4" value="返回"></td>
           	  </tr>
           	</form>
            </table>
        </td>
      </tr>
      <tr>
        <td width="2%">&nbsp;</td>
        <td width="51%" class="left_txt">&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table></td>
    <td background="<%=request.getContextPath()%>/images/mail_rightbg.gif">&nbsp;</td>
  </tr>
  <tr>
    <td valign="bottom" background="<%=request.getContextPath()%>/images/mail_leftbg.gif"><img src="<%=request.getContextPath()%>/images/buttom_left2.gif" width="17" height="17" /></td>
    <td background="<%=request.getContextPath()%>/images/buttom_bgs.gif"><img src="<%=request.getContextPath()%>/images/buttom_bgs.gif" width="17" height="17"></td>
    <td valign="bottom" background="<%=request.getContextPath()%>/images/mail_rightbg.gif"><img src="<%=request.getContextPath()%>/images/buttom_right2.gif" width="16" height="17" /></td>
  </tr>
</table>
</body>
<script type="text/javascript">
	jQuery(function($) {
		var msg="${msg}";
		if(msg!="") alert(msg);
	});

//新增
function add_detail(){
	location.href="<%=request.getContextPath()%>/redirect/addorderdetails/${order.id}/1";
}
//返回
function add_order_back(){
	location.href="<%=request.getContextPath()%>/redirect/addorder";
}
//删除
function del_detail(){
	var detailid=getRadioValue(document.form1.detail_radio);
	if(confirm("确定要删除该订单信息？"))
	$.getJSON("<%=syscontextPath %>/orders/delordersdetail/"+detailid,
		    function(data){
		  		if(data){
		  			alert("删除成功");
		  			location.href="<%=syscontextPath %>/orders/findOrderById/${order.id}";
		  		}else{
		  			alert("删除失败,请重新操作！");
		  		}
				});
}
</script>